﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using r4u.business.logic.layer.RECRUIT;
using r4u.data.access.layer;

namespace r4u.business.logic.layer.ASSESS
{
    public class DoCompare
    {
        public Compare[] Do(string vacancy_id, string applicant1, string applicant2)
        {
            Vacancy vacancy = new Vacancy();
            VACANCY v = vacancy.GetVacancyWithSkills(vacancy_id);
            Candidate[] candidates = vacancy.GetApplicants(vacancy_id);

            Candidate c1 = candidates.FirstOrDefault(c => c.Id.Equals(applicant1));
            Candidate c2 = candidates.FirstOrDefault(c => c.Id.Equals(applicant2));

            Compare compare1 = new Compare(v, c1);
            Compare compare2 = new Compare(v, c2);

            return new Compare[] { compare1, compare2 };
        }
    }
}
